home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
editor
/
mintr151.zip
/
MINITRUE.DOC
< prev
next >
Wrap
Text File
|
1996-08-23
|
56KB
|
1,154 lines
MiniTrue 1.5 Instructions Copyright (c) 1995-6 by Splunge Software
Contents
1 - Introduction
1-1 description
1-2 requirements
1-3 license
1-4 miscellaneous
2 - Command Line Syntax
2-1 overview
2-2 command line options
2-3 files
2-4 strings
2-5 options in depth
3 - Regular Expressions
3-1 introduction
3-2 sets
3-3 variable occurrences
3-4 replacements
3-5 examples
4 - Text Display
4-1 display infomation
4-2 commands
5 - Examples
Appendix A - File Recovery
Appendix B - Return Values
PART 1 - Introduction
1-1 Description
MiniTrue is a fast and versatile search/replace utility run from the
DOS command line. MiniTrue synthesizes the functionality of such
stalwarts as sed, more/less and grep while offering complete
interactivity and a straightforward syntax. MiniTrue is freeware and is
not crippled in any manner. MiniTrue searches the selected file(s) for
the desired string(s). Once a string is found, it is displayed on the
screen along with its context, which can be scrolled through if desired.
If a replacement has been specified for the found string, MiniTrue will
prompt to see if the found string should be changed. These three phases
of operation are explained in more detail: (* denotes a new feature)
Search:
+ All the filenames that will fit on the command line can be
searched. Wildcards in the filenames are allowed.
+ Over 40 strings can be searched for at a time.
+ If the size of the command line buffer is inadequate, input files
containing filenames and strings can be used.
+ Subdirectories can be searched recursively, making disk-wide
searches easy to implement.
+ Regular expressions (similar to UNIX basic regular expressions) are
supported.
+ No limits on either file size or line length
+ The search strings can be linked to form unions. All the strings in
the union must be present within a specific region for a find to be
reported. *The region for the union can be varied by either lines or
bytes.
+ *Minitrue can decompress archives before searching them. The default
dearchiver is PKUNZIP but most popular dearchivers can be used. The
archive files are not altered in any manner.
+ MiniTrue is fast. A 486+ computer searching for one fixed string
should scan at least 1MB per second. (On my AMD 5x86, MiniTrue can
scan roughly 600MB of files in approximately 6 minutes).
Display:
+ *MiniTrue 1.5 does not limit the amount of viewable text to one
screen; it allows scrolling through the entire file in the manner of
the textreaders less and more. If no strings are specified, MiniTrue
can function as a textreader.
+ Can display context in hexadecimal mode.
+ Lines longer than 80 characters are wrapped around, making
horizontal scrolling unnecessary.
+ *Support for nonstandard SVGA modes such as 132 * 43
+ MiniTrue can bypass its textviewer mode and write all the lines
containing matching strings to standard output a la grep.
*Nonmatching lines, all lines or just the matching strings can be
sent to standard output as well. Line numbers and file names can be
included if desired.
+ *Accelerated scrolling - The longer the up/down arrow key is
pressed, the faster MiniTrue will scroll through a file. This
feature can be disabled.
+ *Regular expression color coding - Each part of the regular
expression will have a different color text.
Replace:
+ Prompting is not mandatory - MiniTrue can make all replacements
automatically.
+ A substitute replacement string can be entered. The region of text
to be replaced can be altered as well.
+ Backup files can be made in order to safeguard against the
possibility of unwanted changes. *Either the original file or the
altered file can be saved with a new extension. Backups will never
overwrite previously existing backup files.
+ *If regular expressions are used, the replacement string can include
all or part(s) of the found string.
Other features of MiniTrue 1.5 include:
+ *Capacity to automatically generate a batch file from the given
command line arguments.
+ The number of finds/replacements (for both files and strings) can be
printed when MiniTrue is done.
+ *A log file reporting the locations of the finds and replacements
can be generated.
+ .EXE size of only 76K results in quick startup.
1-2 Requirements
MiniTrue should work on virtually all PCs from 8088s on. About 200K
of free memory is needed. The amount of free space on the disk must be
greater than the size of the largest changed file. For MiniTrue to
alter a 1MB file originally on a diskette, the file must be copied to a
hard drive first. If the /z option is used to scan zipped files, enough
free space on the disk must be present to store the largest uncompressed
file.
1-3 License
This program is freeware, meaning you can use and distribute this
program in any manner you desire without being nagged or obligated in
any way to send in a registration fee. The copyright remains under
control of the programmer. The only manner by which a fee may be
involved in the distribution of the program is if this program is
included on an archive CD-ROM. All other means of charging for this
program require prior permission from Splunge Software. Use this program
at your own risk. No liability will be accepted for any loss resulting
from any usage of this program. SPLUNGE SOFTWARE DISCLAIMS ALL
WARRANTIES EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO, ANY IMPLIED
WARRANTY OR MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
1-4 Miscellaneous
The name of the program is the shorthand form of Ministry of Truth,
which in George Orwell's _1984_ was the name of the bureaucracy
responsible for perpetually revising historical documents. Many
revisions just involved the replacement of one word with another. See
the Monty Python sketch "20th Century Vole" (aka "The Film Writer's
Sketch") for information on the meaning of Splunge.
Please send all comments, suggestions or bug reports to
apipkin@nando.net
See the MiniTrue home page at http://www.webbuild.com/~apipkin for
the latest versions, bug reports, etc.
Thanks to Michael Abrash for enlightening me to Boyer-Moore
algorithms in Chapter 14 of _Zen of Code Optimization_. MiniTrue uses a
Boyer-Moore algorithm written in assembler modified to perform case
insensitive searches. Thanks to this algorithm, searching (for one fixed
string) takes no more than 5% of execution time, with file operations
accounting for the remainder.
Part 2 Command Line Syntax
2-1 Overview
The basic command line format is as follows:
mt [options] [files] / [strings]
mt /abc *.txt *.doc / foo = bar foobar fubar = "bar foo"
Because the number of both filenames and strings is variable, the
slash is needed to separate the two. If only one thing needs to be
searched, the slash can be omitted. With no slash, the first argument
following the options is considered the filename and the remainder are
the strings. Redirected standard input is counted as a file, so all the
arguments after the options are considered strings if the output of
another program is piped into MiniTrue. These are examples of command
lines without the separator slash:
mt [options] file [strings] program | mt [options] strings
mt /q unixfile.txt \n = \r\n dir /s | mt "01-01-96"
If the strings are omitted, MiniTrue will function in a manner
similar to the textviewers more and less. The start of the file will be
displayed and scrolling will enable the remainder of the file to be
viewed. More than one file can be viewed. These command lines will
activat